package com.ruoyi.supply.enums;

import lombok.Getter;

/**
 * @author huangxiong
 * @date 2025/06/14 16:03
 */
@Getter
public enum MemberConsumeTypeEnum {
    // 货源，地点
    SOURCE("0","货源"),
    LOCATION("1","地点"),
    GRADE("2","会员等级");

    private final String code;
    private final String desc;

    MemberConsumeTypeEnum(String code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public static MemberConsumeTypeEnum getByCode(String code){
        for (MemberConsumeTypeEnum memberConsumeTypeEnum : values()) {
            if(memberConsumeTypeEnum.getCode().equals(code)){
                return memberConsumeTypeEnum;
            }
        }
        return null;
    }
}
